<?php
/**
 * Feed分发
 * 
 * @author jiaowei<jiaowei@178.com>
 * @version $Id: api.php 7639 2010-06-22 08:10:58Z jiaowei $
 */
class friends_controller_api extends Controller
{
	//数据验证密钥
	const HASH_KEY = '4a321fee7a123ga4g6896';
	
	private $_mod = null;
	
	public function __construct($app, $controller)
	{
		parent::__construct($app, $controller);
		$this->_mod = new friends_model_data();
	}
	
	/**
	 * 获取多个用户的好友id列表
	 * 
	 * 此方法供好用动态数据分发使用
	 *
	 */
	public function getFriendId_action()
	{		
		$uids = isset($_GET['uids']) ? trim($_GET['uids']) : (isset($_POST['uids']) ? trim($_POST['uids']) : '');
		$hash = isset($_GET['hash']) ? trim($_GET['hash']) : (isset($_POST['hash']) ? trim($_POST['hash']) : '');
		
		if (md5($uids . self::HASH_KEY) != $hash) exit('null');
		
		if (!$uids) exit('null');
		
		exit($this->_mod->getFriendId($uids));
	}
}